<div class="span6">
	<div class="dataTables_info" id="sample_1_info">
		<?php   
				$numpage = ceil($count/$indexAndCount[1]);
				$activePage = ceil(($indexAndCount[0] + 1)/ $indexAndCount[1]);
				if (($activePage * $indexAndCount[1]) >= $count){
					$part2 = $count;
				} else {
					$part2 = $activePage * $indexAndCount[1];
				}  
				//echo "<br>"; print_r($indexAndCount);
				if ($count > 0)
					echo "Showing {$indexAndCount[0]} to {$part2} of {$count} entries"; 
				else 
					echo "Showing 0 to {$part2} of {$count} entries";
				?>
	</div>
</div>
<div class="span6">
	<div class="dataTables_paginate paging_bootstrap pagination">
		<ul>
			
			<?php
				if ($activePage == 1){
					echo '<li class="prev disabled">
							<a href="#">← Prev</a>
						  </li>';	
				} else {
					echo '<li class="prev">
							<a href="#" id="linkPagePrev" onClick="handleGoToPage(event, '.($activePage-1).')">← Prev</a>
						  </li>';
				}
				for ($i=1;$i<=$numpage;$i++){
					if ($i==$activePage){
						echo '<li class="active">';
					} else {
						echo '<li>';	
					}
					echo '	<a href="#" id="linkPage'.$i.'" onClick="handleGoToPage(event, '.$i.')">'.$i.'</a>
						</li>';		
				}
				
				if ($activePage == $numpage){
					echo '<li class="next disabled">
							<a href="#">Next → </a>
						  </li>';	
				} else {
					echo '<li class="next">
							<a href="#" onClick="handleGoToPage(event, '.($activePage+1).')">Next → </a>
						  </li>';
				}
			?>			
		</ul>
	</div>
</div>

<form id="pagingForm" method="post" action="#">
	<input type="hidden" name="activePage" id="activePage"/>
	<input type="hidden" name="numPage" id="numPage"/>
	<input type="hidden" name="searchPage" id="searchPage"/>
</form>
